package com.yequan;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

import static java.math.BigDecimal.ROUND_HALF_UP;

/**
 * 计算金钱
 *
 * @author yequan
 * @date 2020/11/27 11:33
 **/
public class MoneyDemo {


    public static void main(String[] args) {
//        String paymentMoneyString = "15.2";
        String paymentMoneyString = "0";
//        String paymentMoneyString = null;
//        String paymentMoneyString = "";
//        double v = new BigDecimal(StringUtils.isBlank(paymentMoneyString) ? String.valueOf(0) : paymentMoneyString).doubleValue() * 10 * 10;
//        System.out.println(v);
//        double v1 = 75.6 * 100 * (1 + 0.05);
//        System.out.println(v1);
//        int i = new BigDecimal(v1).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
//        System.out.println(i);
//        System.out.println(new BigDecimal(i / 100 / 1.05).setScale(1, BigDecimal.ROUND_HALF_UP).floatValue());
//        float price = 105;
        BigDecimal num = new BigDecimal(139);
        System.out.println(num.setScale(3, ROUND_HALF_UP).floatValue());

    }

}
